cur_exp = proj_meta(input('which exp?'));
layer = 1;
for time_point = 1:4
    cur_act = cur_exp.rd(layer,time_point).act(:,1:7500);
    % generate binary activity during feedback.
    velM_bi = cur_exp.rd(layer,time_point).velM_smoothed(1:7500);
    velM_bi = -velM_bi; % make the velocity of forward-running positive.
    velM_bi(velM_bi > 0.005) = 1;
    velM_bi(velM_bi <= 0.005) = 0;
    
    %calculate average running time percentile
    run_time_p(time_point) = length(velM_bi(velM_bi==1)) / 7500 * 100;
end
avg = mean(run_time_p)